import React from 'react';
import { Route, Switch} from 'react-router-dom'
import CacheRoute, { CacheSwitch } from 'react-router-cache-route'

import Login from './page/login/Login'
import Register from './page/register/index'
import BarHome from './page/barHomePage/index'
import UserDtl from './page/userDtl/index'
import AddContent from './page/addPage/index'
import ContentHome from './page/contentPage/index'
import ReplyPage from './page/replyPage/index'
import CollectionPage from './page/collectionPage/index'
import ApplyPage from './page/apply/index'
import FeedBackPage from './page/feedback/index'
import EditorUserPage from './page/editorUser/index'
import FollowPage from './page/followFans/index'
import SelectBadge from './page/selectBadge/index'
import ErrorPage from './page/error'
import Home from './components/navlinkbar/NavLinkBar'

function App() {
  return (
    <div>
      <CacheSwitch>
        <Route path="/login" exact component={Login} />
        <Route path="/register" component={Register} />
        <CacheRoute path="/home" component={Home} />
        <Route path="/barhome" component={BarHome} />
        <Route path="/userdtl" component={UserDtl} />
        <Route path="/addcontent" component={AddContent} />
        <Route path="/contenthome" component={ContentHome} />
        <Route path="/reply" component={ReplyPage} />
        <Route path="/collection" component={CollectionPage} />
        <Route path="/apply" component={ApplyPage} />
        <Route path="/feedback" component={FeedBackPage} />
        <Route path="/editor" component={EditorUserPage} />
        <Route path="/follow" component={FollowPage} />
        <Route path="/selectbadge" component={SelectBadge} />
        <Route component={ErrorPage} />
      </CacheSwitch>
    </div> 
  )
}

export default App;